/**
 * A simple Kernel
 *
 */
 
#include "multiboot.h"

.text

.globl start
.extern kernel_main

start:

	jmp multiboot_entry
	
	/* Align 32 bits boundary. */
	.align 4

multiboot_header:

	/* magic */
	.long MULTIBOOT_HEADER_MAGIC
	/* flags */
	.long MULTIBOOT_HEADER_FLAGS
	/* checksum */
	.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)

multiboot_entry:

	movl $(stack + STACK_SIZE), %esp

	/* address of multiboot struct */
	push %ebx
	/* magic value */
	push %eax

	/* call c code */
	call EXT_C(kernel_main)

	/* halt */
	hlt

loop:
	jmp loop

.bss 
	.comm stack,STACK_SIZE

	
